package com.eascs.web.o2o.web.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.web.o2o.web.entity.LoanBalance;
import com.eascs.web.o2o.web.service.LoanBalanceForEchartsService;


/**
 * 银行申报进度跟进表
 */
@RestController
@RequestMapping("/echarts/restEcharts")
public class LoanBalanceForEchartsRestController extends BaseRestController {
	
	protected final Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	LoanBalanceForEchartsService chartsReportService;
	
	@RequestMapping(value = "/cityDetail")
	public BaseRestResult<String> cityDetail(String provinceName,String typeName) {
		List<Map<String, Object>>  list1 = chartsReportService.LoanBalanceForCity(provinceName,typeName);
		return BaseRestResult.buildRestResult(JSON.toJSONString(list1));
	}
	
	@RequestMapping(value = "/platDetail")
	public BaseRestResult<String> platDetail(String cityName,String typeName) {
		List<Map<String, Object>>  list1 = chartsReportService.LoanBalanceForPlat(cityName,typeName);
		return BaseRestResult.buildRestResult(JSON.toJSONString(list1));
	}
	
	
	@RequestMapping(value = "/mapDetailForObject")
	public BaseRestResult<String> mapDetailForObject() {
		LoanBalance loanBalance = chartsReportService.LoanBalanceForProvinceObject();
		return BaseRestResult.buildRestResult(JSON.toJSONString(loanBalance));
	}
	
	
	@RequestMapping(value = "/mapDetailForList")
	public BaseRestResult<String> mapDetailForList() {
		List<List<Map<String,Object>>> loanBalance = chartsReportService.LoanBalanceForProvinceList();
		return BaseRestResult.buildRestResult(JSON.toJSONString(loanBalance));
	}
	
	
}
